package com.guijq.selfcode.javacodeoptimize;

/**
 * @author yangjf
 * @time 2019-07-05 13:13
 */
public class StringTest {
    public static void main(String[] args) {
//        String a = new String("abc").intern();
//        String b = new String("abc").intern();
//        System.out.println(a == b);

        String str1= "abc";
        String str2 = new String("abc");
        String str3 = str2.intern();
        System.out.println(str1 == str2);
        System.out.println(str2 == str3);
        System.out.println(str1 == str3);

    }
}
